public class StringArraySort {
    public String[] strings;

    public StringArraySort(String[] strings) {
        this.strings = strings;
    }

    private void arraySort(String[] strings){
        for (int i = 0; i < strings.length - 1; i++) {
            for (int j = 0; j < strings.length -1 - i; j++) {
                if(strings[j].compareTo(strings[j + 1]) > 0){
                    String temp = strings[j];
                    strings[j] = strings[j + 1];
                    strings[j + 1] = temp;
                }
            }
        }
    }
    public void printSort(){
        arraySort(strings);
        for (String str: strings) {
            System.out.println(str);
        }
    }
}
